# -*- coding: utf-8 -*-
"""
Created on Tue Mar 23 14:04:23 2021

@author: hp
"""

import pandas as pd;
def connect_string(x,ms):
    print('k项频繁集:',x);
    x = list(map(lambda i:sorted(i.split(ms)),x));
    l = len(x[0]);
    r = [];
    print('转换x的值:',x);
    for i in range(len(x)):
        for j in range(i,len(x)):
            if x[i][:l-1] == x[j][:l-1] and x[i][l-1] != x[j][l-1]:
                r.append(x[i][:l-1]+sorted([x[j][l-1],x[i][l-1]]));
    print('k+1项候选集:',r);
    return r;